<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    #grid {
      display: grid;
      grid-template-columns: max-content min-content;
      /* min-content 与 max-content 对列轨道的影响较大，因为浏览器解析时先解析列的尺寸，再解析行的尺寸，所以这里 grid-template-rows 的值设为 min-content 或 max-content 都没什么影响 */
      grid-template-rows: max-content min-content;
      background-color: aquamarine;
    }
  </style>
</head>
<body>
  <div id="grid">
    <div>this is first div</div>
    <div>this is second div</div>
    <div>this is third div</div>
    <div>this is fourth div</div>
  </div>
</body>
</html>